package com.test;

import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import it.geosolutions.geoserver.rest.decoder.RESTLayerList;
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList;
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList.RESTShortWorkspace;
import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;

import java.net.MalformedURLException;
import java.util.List;

public class GeoConnect {
	public static void main(String args[]) throws MalformedURLException {
		String RESTURL = "http://localhost:6060/geoserver";
		String RESTUSER = "admin";
		String RESTPW = "geoserver";

		GeoServerRESTReader reader = new GeoServerRESTReader(RESTURL, RESTUSER,
				RESTPW);
		GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(RESTURL,
				RESTUSER, RESTPW);
		RESTWorkspaceList ws= reader.getWorkspaces();
		List<String> rs = reader.getWorkspaceNames();
		RESTLayerList rl= reader.getLayers();
		for (NameLinkElem rr : rl) {
			System.out.println(rr.getName());
		}
	}

}
